package com.five.welcome.controller;


import com.five.welcome.entity.Dormitoryallocation;
import com.five.welcome.result.Result;
import com.five.welcome.service.DormitoryallocationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ywt
 * @since 2024-07-12
 */
@RestController
@CrossOrigin
@Tag(name = "宿舍接口")
@RequestMapping("/dormitoryallocation")
public class DormitoryallocationController {

    @Autowired
    private DormitoryallocationService dormitoryallocationService;

    //查询所有宿舍信息
    @Operation(summary = "查询所有宿舍信息")
    @GetMapping("/getAllDormitory")
    public Result getAllDormitory(){
       List<Dormitoryallocation> dormitoryallocations= dormitoryallocationService.getAll();
       return Result.ok(dormitoryallocations);
    }
}

